package com.zhengxin.one.service.impl;

import com.zhengxin.one.entity.BillAccumulation;
import com.zhengxin.one.entity.BillBase;
import com.zhengxin.one.entity.BillCommercial;
import com.zhengxin.one.entity.BillSociety;
import com.zhengxin.one.entity.excel.PersonExportExcel;
import com.zhengxin.one.mapper.BillMapper;
import com.zhengxin.one.service.BillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
public class BillServiceipml implements BillService {
    @Autowired
    private BillMapper billMapper;
    //添加参保人基础信息
    @Override
    public int insertAll(BillBase bean){
       return billMapper.insertBase(bean);
    }
    //检查参保人是否存在
    @Override
    public Boolean check(String id_card){

        return billMapper.checkUser(id_card);
    }
    @Override
    public Boolean checkA(String id_card){

        return billMapper.checkUserA(id_card);
    }
    @Override
    public Boolean checkS(String id_card){

        return billMapper.checkUserS(id_card);
    }
    @Override
    public Boolean checkC(String id_card){

        return billMapper.checkUserC(id_card);
    }
    //返回参保人参保情况
    @Override
    public BillBase billinfo(String id_card){

        return billMapper.billinfos(id_card);
    }
    //添加社保
    @Override
    public int insertAllSociety(BillSociety bean){

        return billMapper.insertSociety(bean);
    }
    //添加公积金
    @Override
    public int insertAllAccumulation(BillAccumulation bean){

        return billMapper.insertAccumulation(bean);
    }
    //添加商保
    @Override
    public int insertAllCommercia(BillCommercial bean){

        return billMapper.insertCommercial(bean);
    }
    //商保申请失败
    @Override
    public List<Map> getSoFail(String company_id) {
        return billMapper.SoFail(company_id);
    }

    //公积金申请失败
    @Override
    public List<Map> getAcFail(String company_id) {
        return billMapper.AcFail(company_id);
    }
    //商保申请失败
    @Override
    public List<Map> getCoFail(String company_id) {
        return billMapper.CoFail(company_id);
    }
    //参保人模糊查询
    @Override
    public List<BillBase> queryBsLists(String keyword, String company_id,int page,int size) {
        List<BillBase> list = billMapper.queryBsList(keyword,company_id);
        return list;
    }

    @Override
    public List<PersonExportExcel> queryexports(String keyword, String company_id, int page, int size) {
        return billMapper.queryexport(keyword,company_id);
    }

    @Override
    public Map billall(String id_card, int type) {
        return billMapper.billall(id_card,type);
    }


    @Override
    public int handbases(String id_card, int type, int bill_id) {
        return billMapper.handbase(id_card,type,bill_id);
    }
}
